package com.luxoft.scoremanager.server.model.bean;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.luxoft.scoremanager.server.model.entity.StaticData;

import java.io.Serializable;


public class StaticDataBean implements Serializable {
    private static final long serialVersionUID = -5170875020617735655L;

    @JsonProperty("id_static")
    private Integer id;

    private String label;

    private String staticDataSet;

    public StaticDataBean() {

    }

    public StaticDataBean(StaticData staticData) {
        this.setId(staticData.getId());
        this.setLabel(staticData.getLabel());
        this.setStaticDataSet(staticData.getStaticDataSet());
    }

    public StaticDataBean(String label, String staticDataSet) {
        this.label = label;
        this.staticDataSet = staticDataSet;
    }

    @Deprecated
    public StaticDataBean(Integer id, String label, String staticDataSet) {
        this.id = id;
        this.label = label;
        this.staticDataSet = staticDataSet;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getStaticDataSet() {
        return staticDataSet;
    }

    public void setStaticDataSet(String staticDataSet) {
        this.staticDataSet = staticDataSet;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        StaticDataBean that = (StaticDataBean) o;

        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        if (label != null ? !label.equals(that.label) : that.label != null) return false;
        if (staticDataSet != null ? !staticDataSet.equals(that.staticDataSet) : that.staticDataSet != null)
            return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (label != null ? label.hashCode() : 0);
        result = 31 * result + (staticDataSet != null ? staticDataSet.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "StaticData{" +
                "id=" + id +
                ", label='" + label + '\'' +
                ", staticDataSet='" + staticDataSet + '\'' +
                '}';
    }
}



